package game.network
{
	import engine.core.*;
	import game.messages.log.*;
	
	public class RxServerLog
	{
		private static var s_requestedLevel:int = 3;
		
		public function RxServerLog()
		{
		}
		
		public static function Reset() : void
		{
			RxTransactionServer.instance.RemoveListener(RxLog_Message.messageId, OnLogMessage);
			RxTransactionServer.instance.AddListener(RxLog_Message.messageId, OnLogMessage);
		}
		
		private static function OnLogMessage(message:RxLog_Message) : void
		{
			var info:* = "Server: " + message.title + message.details;
			switch(message.severity)
			{
				case RxLog_Message.TRACE:
				{
					RxLog.Trace(info);
					break;
				}
				case RxLog_Message.DEBUG:
				{
					RxLog.Debug(info);
					break;
				}
				case RxLog_Message.INFO:
				{
					RxLog.Info(info);
					break;
				}
				case RxLog_Message.WARNING:
				{
					RxLog.Warning(info);
					break;
				}
				case RxLog_Message.ERROR:
				{
					RxLog.Error(info);
					break;
				}
				default:
				{
					break;
				}
			}
		}
	}
}